package com.tandashi.springbootstudy01.service.user.impl;

import com.tandashi.springbootstudy01.dao.user.WechatUserMapper;
import com.tandashi.springbootstudy01.entity.user.WechatUser;
import com.tandashi.springbootstudy01.service.user.WeChatUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class WeChatUserServiceImpl implements WeChatUserService {

    @Autowired
    private WechatUserMapper wechatUserMapper;


    @Override
    @Transactional(readOnly = true,transactionManager = "userTransactionManager")
    public WechatUser findWeChatUser(String unionid) {
        return wechatUserMapper.getWechatUserByUnionid(unionid);
    }

    @Override
    @Transactional(readOnly = true,transactionManager = "userTransactionManager")
    public WechatUser findWeChatUserByUserId(Long userId) {
        return wechatUserMapper.getWechatUserByUserId(userId);
    }
}
